import * as nls from "monaco-editor/esm/vs/nls";
import zhCN from './zh-cn.json';
const messages = {
  "Show Definition Preview Hover": "显示定义预览悬停",
  "Show or Focus Hover": "显示或焦点悬停",
  "{0} Results": "{0} 结果",
  "{0} Selected": "{0} 选中",
}

nls.localize.message = function (data, message) {
  const key = data && typeof data === 'object' ? data.key : data;
  if (typeof key === 'string' && zhCN[key]) {
    return zhCN[key];
  }
  if (!messages[message]) {
    setTimeout(() => {
      console.log(message, key);
    }, 0)
  }
  return messages[message] || message;
}